package com.yyc.utils.poi;

import java.util.List;

import cn.hutool.poi.excel.sax.Excel03SaxReader;
import cn.hutool.poi.excel.sax.handler.RowHandler;

public class ReadExcelStream {
	
	private RowHandler createRowHandler() {
	    return new RowHandler() {
	    	@Override
	        public void handle(int sheetIndex, int rowIndex, List<Object> rowlist) {
	            //Console.log("[{}] [{}] {}", sheetIndex, rowIndex, rowlist);
	    		
	        }
	    };
	}
	
	//reader方法的第二个参数是sheet的序号，-1表示读取所有sheet，0表示第一个sheet，依此类推。
	public static void main(String[] args) {
		ReadExcelStream read = new ReadExcelStream();
		Excel03SaxReader reader = new Excel03SaxReader(read.createRowHandler());
		reader.read("C:\\Users\\Administrator\\Desktop\\user.xls", -1);
	}
	
}
